package ua.edu.nuos.jeetraining2012.automator.translator.bl;

import ua.edu.nuos.jeetraining2012.automator.translator.dao.TranslatorDao;
import ua.edu.nuos.jeetraining2012.automator.translator.vo.InhouseEntity;

import javax.xml.bind.JAXBException;
import java.nio.file.Path;

/**
 * @author Timur Yarosh
 *         Date: 03.06.13
 *         Time: 21:02
 */
public class TranslatorService {
    private Path inhousePath;
    private Path bpmnPath;

    public TranslatorService(Path inhousePath, Path bpmnPath) {
        this.inhousePath = inhousePath;
        this.bpmnPath = bpmnPath;
    }

    public Path getBpmnPath() {
        return bpmnPath;
    }

    public void setBpmnPath(Path bpmnPath) {
        this.bpmnPath = bpmnPath;
    }

    public Path getInhousePath() {
        return inhousePath;
    }

    public void setInhousePath(Path inhousePath) {
        this.inhousePath = inhousePath;
    }

    public void translateToBpmn2() {
        try {
            TranslatorDao translator = new TranslatorDao();
            InhouseEntity inhouseEntity = translator.loadInhouseEntity(inhousePath);

            //TODO translator

            translator.storeBpmn2Entity(null, bpmnPath);
        } catch (JAXBException e) {
            System.out.println(e.getMessage());
        }
    }


}
